package model.pojo;

import java.sql.ResultSet;

import models.util.MySqlDataAccessHelper;

public class AcAccountMenuLeft {
	private String iDMenuLeft;
	private String iDMenuLevel;
	private String menuLeftName;
	private String description;
	private String leftLinkPage;
	
	public String getIDMenuLeft() {
		return iDMenuLeft;
	}
	public void setIDMenuLeft(String iDMenuLefta) {
		iDMenuLeft = iDMenuLefta;
	}
	public String getIDMenuLevel() {
		return iDMenuLevel;
	}
	public void setIDMenuLevel(String iDMenuLevela) {
		iDMenuLevel = iDMenuLevela;
	}
	public String getMenuLeftName(String lang) {
		MySqlDataAccessHelper mysql = new MySqlDataAccessHelper();
		try {
			mysql.open();
			String sql="select "+lang+" as MenuLeftName " +
					"from admin.ac_accountmenuleft, admin.configlang " +
					"where admin.ac_accountmenuleft.IDMenuLeft=admin.configlang.ID " +
					"and admin.ac_accountmenuleft.IDMenuLeft='"+this.iDMenuLeft+"'";
			ResultSet rs = mysql.executeQuery(sql);
			//System.out.println("name: "+sql);
			if(rs.next()){
				menuLeftName=rs.getString("MenuLeftName");
			}
			rs.close();
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			mysql.close();
		}
		return menuLeftName;
	}
	public void setMenuLeftName(String menuLeftNamea) {
		menuLeftName = menuLeftNamea;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String descriptiona) {
		description = descriptiona;
	}
	public String getLeftLinkPage() {
		return leftLinkPage;
	}
	public void setLeftLinkPage(String leftLinkPagea) {
		leftLinkPage = leftLinkPagea;
	}
	
	
	
}
